'use strict';

var mongoose = require('mongoose'),
    Schema = mongoose.Schema,
    baseController = require('../../../Base/server/controllers/BaseDoc.js');

var newModel = baseController.getBaseDocFields();
//生产订单
newModel.MO = {
    type: Schema.ObjectId,
    ref: 'MO'
};
//交接区
newModel.ConnectArea = {
    type: Schema.ObjectId,
    ref: 'ConnectArea'
};
//累计要货量
newModel.TotalDemandQty = {
    type: Number
};
//累计备货量
newModel.TotalStockQty = {
    type: Number
};
//累计已接收量
newModel.TotalReceiveQty = {
    type: Number
};
//优先级
newModel.Priority = {
    type: Number
};

var newSchema = new Schema(newModel);
newSchema.index({_id: 1}, {"unique": true});

mongoose.model('KanbanDemand', newSchema, 'KanbanDemand');
